package com.service;

import com.github.pagehelper.PageHelper;
import com.mapper.NewsMapper;
import com.pojo.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewsService {
    @Autowired
    private NewsMapper mapper;

    public List<News> findByPage(int page, int size) {
        //PageHelper.startPage
        PageHelper.startPage(page, size);
        List<News> newsList = mapper.findAll();
        return newsList;
    }
}
